<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<head>
<title>Guitar Air!</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine|Inconsolata|Droid+Sans|Neon|Rancho&effect=shadow-multiple|3d-float|neon|fire-animation">
<script type="text/javascript" src="/ga/resources/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/ga/resources/js/common.js"></script>
<script type="text/javascript">
	$(function() {
		$("table").css("background","url("+window.context+"/resources/images/default.jpg)");
		$("embed").attr("src",window.context+"/title.swf");
		$("table").fadeIn(400);
		document.onkeydown = function(e) {
			var ev = document.all ? window.event : e;
			if (ev.keyCode == 13) {
				login();
			}
		}
		$("#login").click(function() {
			login();
		})
	});
	function login() {
		var json = $("#loginForm").serializeJSON();
		$.post(window.context+"/user/login", json, function(data) {
			// 存入 localStorage
			localStorage.setItem("uname", json.uname);
			localStorage.setItem("pwd", data.pwd);
			if (data.flag==1) {
				window.location.href=window.context+'/bm/home';
			} else {
				alert("用户名或密码错误 ! ");
			}
		});
	}
</script>
<style type="text/css">
input[type=text],input[type=password] {
	padding-left: 5px;
	width: 90%;
	height: 35px;;
	border:0;
	background: #747474;
	color:#fff;
}
table{
/*  	border-collapse: collapse; */
	margin-top:125px;
    display: none;
    color: #fff;
}
span{
	font-size: 20px;
	color: #FFB74D;
	font-style:italic;
	text-shadow: 1px 2px 2px #FFB74D;
}
</style>
</head>
<body>
	<form id="loginForm">
			<table align="center" height="280px" width="450px;" cellpadding="0" cellspacing="0" >
				<tr>
					<td colspan="2" align="left" >&nbsp;&nbsp;
						<span>Idol Guitar Air !</span>
					</td>
				</tr>
				<tr>
					<td align="right">用户名：</td>
					<td align="left" ><input name="uname" type="text" value="admin@ga.com" /></td>
				</tr>
				<tr>
					<td align="right">密码：</td>
					<td align="left" ><input name="pwd" type="password" value="admin123" /></td>
				</tr>
				<tr>
					<td colspan="2" align="right" style="vertical-align: middle;">
						<input type="checkbox" checked="checked" />记住密码 
						<input type="button" value="登 录" id="login"  class="button blue" /> 
						<input type="reset" value="重 置" class="button blue"  />
						<input type="button" value="首 页"  class="button green"  onclick="window.location.href=window.context" /> 
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					</td>
				</tr>
			</table>
	</form>
</body>
</html>
